package com.prs.crm.service.document.report.impl;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.prs.crm.dao.document.report.ReportFormCenterDao;
import com.prs.crm.domain.document.report.ReportFormCenter;
import com.prs.crm.service.document.report.ReportFormCenterService;
import com.prs.crm.service.impl.BaseServiceImpl;

public class ReportFormCenterServieImpl extends BaseServiceImpl<ReportFormCenter, ReportFormCenterDao> implements ReportFormCenterService{

	

	@Override
	public Collection<ReportFormCenter> convertToReport(String ids) {
		try {
			Collection<ReportFormCenter> report=new ArrayList<ReportFormCenter>();
			for (String id : ids.split(",")) {
				ReportFormCenter re=new ReportFormCenter();
					re.setId(Integer.parseInt(id));
					report.add(re);
				}
			return report;
		} catch (NumberFormatException e) {
			e.printStackTrace();
			return null;
		}
	}

	@Override
	public Collection<ReportFormCenter> getRootReportFormCenter() {
		return this.getDao().getRootReportFormCenter();
	}

	@Override
	public List<ReportFormCenter> getReportFormCenter() {
		return this.getDao().getReportFormCenter();
	}

	@Override
	public int removeReport(Integer id) {
		return this.getDao().removeReport(id);
	}

	@Override
	public List<ReportFormCenter> getAllReportFormCenter() {
		return this.getDao().getAllReportFormCenter();
	}

}
